<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/common.css">
<title></title>
</head>
<body>
	<#import "/page.ftl" as page />
	<script type="text/javascript" src="/js/discuss.js" charset="UTF-8"></script>
	<link rel="stylesheet" href="/css/looktable.css" type="text/css">
	<#include "/head.ftl"/>
		<div class="content">
				<div class="tab">
					<div class="tab-header">
						<a href="/discuss/add" title="发帖" class="btn btn-setting btn-add" id="add"> <i class="iconfont icon-add"
							style="font-size: 16px;"></i>
						</a>
						<a title="刷新" class="btn btn-setting" onclick="refresh(this)">
							<i class="iconfont icon-refresh"></i>
						</a>
						<form class="tab-tool" method="get" id="discussSearch">
							<input name="key" type="text" placeholder="按关键字查找...">
							<button class="search-btn">
								<i class="iconfont icon-search"></i>
							</button>
						</form>
					</div>	
					<div class="discuss_head">
						<#list (type) as type>
								<#if type.value == RequestParameters.comment?number>
								<a class="discuss selected" href="/discuss?comment=${type.value}" title="讨论">${type.name}</a>
								<#else>
								<a class="discuss" href="/discuss?comment=${type.value}" title="讨论">${type.name}</a>
								</#if>
						</#list>
						
						
					</div>
					<div class="discuss_container">
						<div class="discuss_content selected">
							<div class="sort">
								<div class="select_sort">按${str}排序<i id="down_icon" class="iconfont icon-down"></i></div>
								<div class="drift">
										<#if RequestParameters.comment?number == 0 || RequestParameters.comment?number == 1>
										<a class="time" onclick="pageSort('${requestURI}','newTime,desc')">时间</a>
										<#else>
										<a class="time" onclick="pageSort('${requestURI}','discuss.newTime,desc')">时间</a>
										</#if>
										<hr>
										<#if RequestParameters.comment?number == 0 || RequestParameters.comment?number == 1>
										<a class="comment" onclick="pageSort('${requestURI}','commentNum,desc')">评论数</a>
										<#else>
										<a class="comment" onclick="pageSort('${requestURI}','discuss.commentNum,desc')">评论数</a>
										</#if>
								</div>
							</div>
							
							<#list discuss.content as discuss>
								<div class="discuss_list">
									<div class="user_message">
										<#list status as sta>
											<#if discuss.status == sta.value>
										 	<span class="btn" style="background-color: ${sta.color}">${sta.name}</span> 
										 	</#if>
										</#list>
										<img alt="" src="/file/image/${discuss.user.photo}">
										<p>${discuss.user.name}</p>
									</div>
									<div class="discuss_base_message">
										<div class="base_message_title">
											<span>
												<#if discuss.type == 0 || discuss.type == 1>
												  <a href="/discuss/view?id=${discuss.id}" title="查看帖子">${discuss.title}</a>
												<#elseif discuss.type == 2 >
												  <a href="/discuss/view/vote?id=${discuss.id}" title="查看帖子">${discuss.title}</a>
												<#elseif discuss.type == 3 >
												  <a href="/discuss/view/active?id=${discuss.id}" title="查看帖子">${discuss.title}</a>
												</#if>
											</span>
										</div>
										<div class="comment_num">
											<div>${(discuss.commentNum)!"0"}</div>
											<div>评论</div>
										</div>
										<div class="discuss_time">
										${discuss.pushTime}
										</div>
									</div>
								</div>
							</#list>
							<@page.page url=requestURI pager=discuss/>
					</div>					
				</div>
				
			</div>
</body>
</html>


